// components/lt-list/lt-list.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    title: {
      type:String,
      value: "--"
    },
    desc: {
      type: String,
      value: "----"
    },
    list: {
      type: Array,
      value: []
    },
    item:{
      type: Object,
      value: {}
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    dataList: [
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '北京三日游最全攻略，让我们成功拿下。北京三日游最全攻略，让我们成功拿下。北京三日游最全攻略，让我们成功拿下。',
        infoImg: '/static/no-avatar.png',
        collectStatus: true,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 503,
        dataFrom: '北京',
        time: '2023-10-2',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '让我们成功拿下。',
        infoImg: '/static/no-avatar.png',
        collectStatus: false,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 43,
        dataFrom: '北京',
        time: '2023-10-2',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '北京三日游最全攻略，让我们成功拿下。',
        infoImg: '/static/no-avatar.png',
        collectStatus: true,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 2,
        dataFrom: '上海',
        time: '三天前',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '北京三日游最全攻略，让我们成功拿下。加油加油加加油！！！！',
        infoImg: '/static/no-avatar.png',
        collectStatus: false,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 1120,
        dataFrom: '南京',
        time: '2023-10-2',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '北京三日游最全攻略，让我们成功拿下。',
        infoImg: '/static/no-avatar.png',
        collectStatus: false,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 548,
        dataFrom: '北京',
        time: '19:45',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '北京三日游最全攻略，让我们成功拿下。加油加油加加油！！！！',
        infoImg: '/static/no-avatar.png',
        collectStatus: false,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 1120,
        dataFrom: '成都',
        time: '2023-10-2',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '北京三日游最全攻略，让我们成功拿下。',
        infoImg: '/static/no-avatar.png',
        collectStatus: false,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 548,
        dataFrom: '北京',
        time: '2023-10-2',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '让我们成功拿下。',
        infoImg: '/static/no-avatar.png',
        collectStatus: false,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 43,
        dataFrom: '广州',
        time: '2023-10-2',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '北京三日游最全攻略，让我们成功拿下。',
        infoImg: '/static/no-avatar.png',
        collectStatus: true,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 2,
        dataFrom: '北京',
        time: '2023-10-2',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '北京三日游最全攻略，让我们成功拿下。加油加油加加油！！！！',
        infoImg: '/static/no-avatar.png',
        collectStatus: false,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 1120,
        dataFrom: '西安',
        time: '2023-10-2',
      }, 
      {
        bigImg: '/static/swiper/1.jpg',
        bigName: '北京三日游最全攻略，让我们成功拿下。',
        infoImg: '/static/no-avatar.png',
        collectStatus: true,
        infoName: '千秋岁',
        smallTitle: '让我们成功拿下。北京三日游最全攻略',
        likeNum: 548,
        dataFrom: '北京',
        time: '2023-10-2',
      }
    ],
  },

  /**
   * 生命周期
   */
  pageLifetimes: {
    show: function() {
      console.dir("这里是lt-list的show");
    },
    hide: function() {
      console.dir("这里是lt-list的hide");
    },
    resize: function(size) {
      console.log('这里是lt-list的resize', size)

    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    navigateToDetail(e) {
      const item = e.currentTarget.dataset.item
      wx.navigateTo({
        url: '/pages/detailList/detailList?item='+JSON.stringify(item),
        events: {
          // 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
          acceptDataFromOpenedPage: function(data) {
            console.log('1', data)
          },
          someEvent: function(data) {
            console.log('2', data)
          }
        },
        success: function(res) {
          // 通过eventChannel向被打开页面传送数据
          res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
        }
      })
    },
  },
  created(){
    console.log('这里是lt-list的created')
  }
})